package jf.collections;

import java.util.Collection;
import java.util.Iterator;

import static jf.collections.CollectionF.asMap;
import jf.collections.primitive.LinkedHashSet;

/**
 * @author ivanalx
 * @date 29.05.2009 18:34:25
 */
public class LinkedHashSetX<A> extends AbstractSetX<A> {
	private LinkedHashSet<A> base;

	public LinkedHashSetX(int capacity) {
		base = new LinkedHashSet<A>(capacity);
	}

	public LinkedHashSetX() {
		base = new LinkedHashSet<A>();
	}

	public LinkedHashSetX(Collection<? extends A> col) {
		base = new LinkedHashSet<A>(col);
	}

	@Override
	public <A> SetX<A> createNewSet() {
		return new LinkedHashSetX<A>();
	}

	@Override
	public <A> SetX<A> createNewSet(int capacity) {
		return new LinkedHashSetX<A>(capacity);
	}

	@Override
	public <A> SetX<A> createNewSet(Collection<? extends A> col) {
		return new LinkedHashSetX<A>(col);
	}

	@Override
	protected Collection<A> getBaseCollection() {
		return base;
	}

	@Override
	public Iterator<A> rightIterator() {
		return base.rightIterator();
	}
}
